
import Vue from 'vue'
import VueRouter from 'vue-router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import ElementUI from 'element-ui'

import 'element-ui/lib/theme-chalk/index.css';
import './assets/less/base.less'


import wangyuSystem from './wangyuSystem.vue'
import gameAccount from './views/Mall/goodsManage/competitionMall/gameAccount.vue'
import addAccount from './views/Mall/goodsManage/competitionMall/addAccount.vue'
import userList from './views/user/userList.vue'
import userDetail from './views/user/userDetail.vue'
import netBarUserList from './views/user/netBarUserList.vue'
import netBarUserDetail from './views/user/netBarUserDetail.vue'
import gameTools from './views/Mall/goodsManage/competitionMall/gameTools.vue'
import addTools from './views/Mall/goodsManage/competitionMall/addTools.vue'
import gameAccelerator from './views/Mall/goodsManage/competitionMall/gameAccelerator.vue'
import addAccelerator from './views/Mall/goodsManage/competitionMall/addAccelerator.vue'
import eAccelerator from './views/order/eAccelerator.vue'
import eAccount from './views/order/eAccount.vue'
import eProp from './views/order/eProp.vue'
import shopOder from './views/order/shopOder.vue'
import loginIn from './views/loginIn.vue'
import orderList from './views/APP/QBi/orderList.vue'
import goodsManage from './views/APP/QBi/goodsManage.vue'


import peripheralList from './views/Mall/goodsManage/peripheral/peripheralList.vue'
import addPeripheral from './views/Mall/goodsManage/peripheral/addPeripheral.vue'
import updatePeripheral from './views/Mall/goodsManage/peripheral/updatePeripheral.vue'
import * as filters from './filters/index.js'

import fn from './util/fn'
Vue.use(VueRouter);
Vue.use(VueAxios, axios);
Vue.use(ElementUI);
Vue.use(fn);

// axios.defaults.baseURL = 'http://3s.dkys.org:28063/';  //dev/test
// axios.defaults.baseURL = 'http://172.16.10.71:8285/';  //dev/test
axios.defaults.baseURL = 'http://wyds.new.91wangjing.com/';  //pro
 
Vue.config.productionTip = false

// 注册全局的过滤器
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

const routes = [
    { path: '/gameAccount', component: gameAccount },
    { path: '/addAccount', component: addAccount },
    { path: '/userList', component: userList },
    { path: '/userDetail/:id', component: userDetail },
    { path: '/netBarUserList', component: netBarUserList },
    { path: '/netBarUserDetail/:id', component: netBarUserDetail },
    { path: '/gameTools', component: gameTools },
    { path: '/addTools', component: addTools },
    { path: '/gameAccelerator', component: gameAccelerator },
    { path: '/addAccelerator', component: addAccelerator },
    { path: '/eAccelerator', component: eAccelerator },
    { path: '/eAccount', component: eAccount },
    { path: '/eProp', component: eProp },
    { path: '/shopOder', component: shopOder },
    { path: '/loginIn', component: loginIn },
    { path: '/orderList', component: orderList },
    { path: '/goodsManage', component: goodsManage },
    { path: '/peripheralList', component: peripheralList },
    { path: '/addPeripheral', component: addPeripheral },
    { path: '/updatePeripheral', component: updatePeripheral },
    { path: '*', redirect: '/loginIn' }

]

const router = new VueRouter({
    routes
});

var app = new Vue({
    el: '#app',
    router,
    render: h => h(wangyuSystem)
})